package com.dayuanit.dy8.mall.springbootmall.controller;

import com.dayuanit.dy8.mall.springbootmall.dto.ResponseDTO;
import com.dayuanit.dy8.mall.springbootmall.service.CatalogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HomeController {

    @Autowired
    private CatalogService catalogService;

    @RequestMapping("/getCatalog")
    public ResponseDTO getCatalog() {
        return ResponseDTO.success(catalogService.listCatalog());
    }

    @RequestMapping("/getHomeCommon")
    public ResponseDTO getHomeCommon() {
        return ResponseDTO.success(catalogService.listHomeCommon());
    }

}
